<?php

/**
 * AVE.cms - Модуль RSS
 *
 * @package AVE.cms
 * @subpackage module_RSS
 * @filesource
 */

/**
 * mySQL-запросы для установки, обновления и удаления модуля
 */

$module_sql_install = array();
$module_sql_deinstall = array();
$module_sql_update = array();

//Удаление модуля
$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_modul_rss;";

//Установка модуля
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_rss (
  `id` smallint(3) unsigned NOT NULL auto_increment,
  `rss_site_name` char(255) NOT NULL,
  `rss_site_description` char(255) NOT NULL,
  `rss_site_url` char(255) NOT NULL,
  `rss_rubric_id` smallint(3) unsigned NOT NULL,
  `rss_title_id` int(10) unsigned NOT NULL,
  `rss_description_id` int(10) unsigned NOT NULL,
  `rss_item_on_page` tinyint(1) unsigned NOT NULL,
  `rss_description_lenght` smallint(3) unsigned NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";

// Обновление модуля
$module_sql_update[] = "
  UPDATE
    `CPPREFIX_module`
  SET
    ModuleAveTag = '" . $modul['ModuleAveTag'] . "',
    ModulePHPTag = '" . $modul['ModulePHPTag'] . "',
    ModuleVersion = '" . $modul['ModuleVersion'] . "'
  WHERE
    ModuleSysName = '" . $modul['ModuleSysName'] . "'
  LIMIT 1;
";

$module_sql_update[] = "
  RENAME TABLE
    `CPPREFIX_modul_rss`
  TO
    `CPPREFIX_module_rss`
";
?>